<div>
  <form (ngSubmit)="onSubmit()" [formGroup]="form" class="p-grid p-fluid">

    <div *ngFor="let formItem of formItems" class="p-col-3 p-fluid">
      <app-form-item [formItem]="formItem" [form]="form"></app-form-item>
    </div>

    <div style="display: flex;margin-bottom: 1rem;">
      <button pButton type="submit" [disabled]="!form.valid" label="保存"></button>
      <button pButton type="reset"  label="重置"></button>
    </div>
  </form>

  <div *ngIf="payLoad" class="form-row">
    <strong>Saved the following values</strong><br>{{payLoad}}
  </div>
</div>
